Skip to content

Propagate route harvest cancellation#2423

Open
MrAlias wants to merge 1 commit into
open-telemetry:mainfrom
MrAlias:codex/2034-route-harvester-integration
Open

Propagate route harvest cancellation#2423
MrAlias wants to merge 1 commit into
open-telemetry:mainfrom
MrAlias:codex/2034-route-harvester-integration

Conversation

@MrAlias

@MrAlias MrAlias commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Thread the route harvest timeout context into Java route extraction.
  • Use the context-aware JVM attach path for Java route harvesting.
  • Close the route output reader when the harvest context is canceled so blocked reads can unwind.
  • Add tests for repeated Java harvest timeouts and canceled blocked route output reads.

Why

This completes the route-harvester integration step for #2034 after the internal JVM attach path gained context support. Previously, the harvester could return on timeout while the Java extraction worker continued blocked in the background. Passing the timeout context through attach and output reading gives the worker a cancellation path instead of accumulating retained workers across repeated timeouts.

Fixes #2034.

Validation

  • make generate
  • go test ./pkg/internal/transform/route/harvest
  • go test ./pkg/internal/jvmtools/...
  • GOOS=darwin go test -c -o /tmp/harvest-darwin.test ./pkg/internal/transform/route/harvest
  • go test ./pkg/internal/transform/route/...

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.94118% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.01%. Comparing base (4a7d78e) to head (3354810).

Files with missing lines Patch % Lines
...g/internal/transform/route/harvest/java/archive.go 26.98% 35 Missing and 11 partials ⚠️
...internal/transform/route/harvest/java/extractor.go 33.33% 7 Missing and 3 partials ⚠️
pkg/internal/transform/route/harvest/harvester.go 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2423      +/-   ##
==========================================
- Coverage   69.11%   69.01%   -0.10%     
==========================================
  Files         332      332              
  Lines       44197    44252      +55     
==========================================
- Hits        30546    30542       -4     
- Misses      11775    11817      +42     
- Partials     1876     1893      +17     
Flag Coverage Δ
integration-test 51.14% <18.18%> (-0.22%) ⬇️
integration-test-arm 27.66% <0.00%> (+0.38%) ⬆️
integration-test-vm-5.15-lts ?
integration-test-vm-6.18-lts ?
k8s-integration-test 37.07% <0.00%> (+0.04%) ⬆️
oats-test 36.50% <18.18%> (+0.19%) ⬆️
unittests 62.49% <39.39%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@MrAlias MrAlias marked this pull request as ready for review June 18, 2026 00:17
@MrAlias MrAlias requested a review from a team as a code owner June 18, 2026 00:17

@mariomac mariomac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good!!! I just have few cosmetic suggestions.

Comment thread pkg/internal/transform/route/harvest/harvester.go Outdated
Comment thread pkg/internal/transform/route/harvest/java.go Outdated
Comment thread pkg/internal/transform/route/harvest/java.go Outdated
Comment thread pkg/internal/transform/route/harvest/java.go Outdated
Comment thread pkg/internal/transform/route/harvest/java.go Outdated

@grcevski grcevski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrAlias MrAlias added this to the v0.10.0 milestone Jun 18, 2026
@MrAlias MrAlias added bug Something isn't working java Java agent related area: route-harvesting Route extraction and route harvester behavior labels Jun 18, 2026
Pass harvest contexts through Java
@MrAlias MrAlias force-pushed the codex/2034-route-harvester-integration branch from e59de9d to 3354810 Compare June 18, 2026 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: route-harvesting Route extraction and route harvester behavior bug Something isn't working java Java agent related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeout does not cancel blocked Java extraction

3 participants